<template>
  <div class="home">
    <el-form :inline="true">
      <el-form-item>
        <el-input placeholder="输入搜索的名字" width='300px'></el-input>
      </el-form-item>
      <el-form-item>
        <el-button tupe='primary '>添加用户</el-button>
      </el-form-item>
    </el-form>

    <el-table>
      <el-table-column label="#"></el-table-column>
      <el-table-column label="用户名" prop="username"></el-table-column>
      <el-table-column label="角色" prop="role_name"></el-table-column>
      <el-table-column label="电话" prop="mobile"></el-table-column>
      <el-table-column label="邮箱" prop="email"></el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button icon="el-icon-edit" type="primary"></el-button>
          <el-button icon="el-icon-delete " type="danger"></el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>

export default {
  name: 'Home',
  data() {
    return {
      userlist:[],
    }
  },
    mounted() {
      this.getList();
    },
    methods: {
      getList(){
        this.http.get('/userlist.json').then(res=>{
          console.log(res)
          this.userlist = res.data.users;
        })
      }
    },
}
</script>
<style scoped>
  .home{
    width: 80%;
    margin: 30px auto;
  }
</style>